package com.example.spring_source_code.anno.component01;

import org.springframework.context.support.GenericApplicationContext;

import java.io.IOException;

// 如何获取@component的bean
public class Component01 {
    public static void main(String[] args) throws IOException {
        //一个干净的容器
        GenericApplicationContext context = new GenericApplicationContext();
        //注册bean
        context.registerBean(ComponentScanBeanFactoryPostProcessor.class);


        context.refresh();
        for (String beanDefinitionName : context.getBeanDefinitionNames()) {
            System.out.println("beanDefinitionName = " + beanDefinitionName);
        }
    }
}
